﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="attribute_field_edit.aspx.cs" Inherits="ByteSite.Web.admin.form.attribute_field_edit" ValidateRequest="false" %>
<%@ Import namespace="ByteSite.Common" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑字段</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" href="../../scripts/artdialog/ui-dialog.css" />

<link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
<link href="../skin/uikit/css/uikit.min.css" rel="stylesheet" />
<script type="text/javascript" src="../skin/uikit/js/uikit.min.js"></script>
<script type="text/javascript" src="../skin/uikit/js/uikit-icons.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="../../scripts/xm-select/xm-select.js"></script>
<script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
<script type="text/javascript">
    $(function () {
        //初始化表单验证
        $("#form1").initValidform();
        $("#ddlRegularExpression").change(function () {
            console.log("change");
            if ($("#ddlRegularExpression").val() !== '') {
                $("#txtValidPattern").val($("#ddlRegularExpression").val());
                $("#txtValidErrorMsg").val("验证失败");
            } else {
                $("#txtValidPattern").val("");
                $("#txtValidErrorMsg").val("");
            }
        })
    });
</script>
</head>

<body class="mainbody">
<form id="form1" runat="server">


<!--内容-->

      <ul uk-tab>
        <li class="uk-active"><a class="" href="javascript:;">字段信息</a></li>
      </ul>


<div class="tab-content">
  <dl>
    <dt>控件类型</dt>
    <dd>
      <div class="rule-single-select">
        <asp:DropDownList ID="ddlControlType" runat="server" CssClass="uk-select" datatype="*" 
              errormsg="请选择控件类型！" sucmsg=" " AutoPostBack="True" 
              onselectedindexchanged="ddlControlType_SelectedIndexChanged">
              <asp:ListItem Value="single-text">单行文本</asp:ListItem>
              <asp:ListItem Value="multi-text">多行文本</asp:ListItem>
              <asp:ListItem Value="editor">编辑器</asp:ListItem>
              <asp:ListItem Value="image">图片上传</asp:ListItem>
              <asp:ListItem Value="multi-images">多图上传</asp:ListItem>
              <asp:ListItem Value="video">视频上传</asp:ListItem>
              <asp:ListItem Value="number">数字</asp:ListItem>
              <asp:ListItem Value="datetime">时间日期</asp:ListItem>
              <asp:ListItem Value="date">日期</asp:ListItem>
              <asp:ListItem Value="checkbox">复选框</asp:ListItem>
              <asp:ListItem Value="multi-radio">多项单选</asp:ListItem>
              <asp:ListItem Value="multi-checkbox">多项多选</asp:ListItem>
              <asp:ListItem Value="dropdownlist">单选菜单</asp:ListItem>
              <asp:ListItem Value="multi-dropdownlist">多选菜单</asp:ListItem>
          </asp:DropDownList>
       </div>
     </dd>
  </dl>

  <dl>
    <dt>排序数字</dt>
    <dd><asp:TextBox ID="txtSortId" runat="server" CssClass="uk-input uk-form-width-small" datatype="n" sucmsg=" ">99</asp:TextBox> <span class="Validform_checktip">*数字，越小越向前</span></dd>
  </dl>

  <dl>
    <dt>字段列名</dt>
    <dd><asp:TextBox ID="txtName" runat="server" CssClass="uk-input" datatype="/^[a-zA-Z0-9\-\_]{2,50}$/" sucmsg=" " aajaxurl="../../tools/admin_ajax.ashx?action=attribute_field_validate"></asp:TextBox> <span class="Validform_checktip">*字母、下划线，不可修改</span></dd>
  </dl>

  <dl>
    <dt>字段标题</dt>
    <dd><asp:TextBox ID="txtTitle" runat="server" CssClass="uk-input" datatype="*" sucmsg=" "></asp:TextBox> <span class="Validform_checktip">*中文标题，做为备注</span></dd>
  </dl>
  
  <dl>
    <dt>是否必填</dt>
    <dd>
      <div class="rule-single-checkbox">
          <asp:CheckBox ID="cbIsRequired" runat="server" />
      </div>
    </dd>
  </dl>

  <dl id="dlIsPassWord" runat="server" class="single-text-tr">
    <dt>是否密码框</dt>
    <dd>
      <div class="rule-single-checkbox">
          <asp:CheckBox ID="cbIsPassword" runat="server" />
      </div>
    </dd>
  </dl>

  <dl id="dlIsHtml" runat="server" class="multi-text-tr">
    <dt>是否允许HTML</dt>
    <dd>
      <div class="rule-single-checkbox">
          <asp:CheckBox ID="cbIsHtml" runat="server" />
      </div>
    </dd>
  </dl>

  <dl id="dlEditorType" runat="server" class="editor-tr">
    <dt>编辑器类型</dt>
    <dd>
      <div class="rule-multi-radio">
          <asp:RadioButtonList ID="rblEditorType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
              <asp:ListItem Value="0" Selected="True">标准型</asp:ListItem>
              <asp:ListItem Value="1">简洁型</asp:ListItem>
          </asp:RadioButtonList>
      </div>
    </dd>
  </dl>

  <dl id="dlDataType" runat="server" class="multi-radio-tr">
    <dt>字段类型</dt>
    <dd>
       <div class="rule-multi-radio">
          <asp:RadioButtonList ID="rblDataType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
              <asp:ListItem Value="nvarchar" Selected="True">字符串</asp:ListItem>
              <asp:ListItem Value="int">整型数字</asp:ListItem>
          </asp:RadioButtonList>
      </div>
     </dd>
   </dl>

   <dl id="dlDataLength" runat="server" class="single-text-tr multi-text-tr multi-radio-tr multi-checkbox-tr">
    <dt>字符串长度</dt>
    <dd><asp:TextBox ID="txtDataLength" runat="server" CssClass="uk-input uk-form-width-small" datatype="n" sucmsg=" "></asp:TextBox> <span class="Validform_checktip">*数字，默认50个字符</span></dd>
   </dl>

   <dl id="dlDataPlace" runat="server" class="number-tr">
    <dt>小数点位数</dt>
    <dd>
      <div class="rule-single-select">
        <asp:DropDownList ID="ddlDataPlace" runat="server" CssClass="uk-select">
              <asp:ListItem Value="0">无小数点</asp:ListItem>
              <asp:ListItem Value="1">一位</asp:ListItem>
              <asp:ListItem Value="2">二位</asp:ListItem>
              <asp:ListItem Value="3">三位</asp:ListItem>
              <asp:ListItem Value="4">四位</asp:ListItem>
              <asp:ListItem Value="5">五位</asp:ListItem>
          </asp:DropDownList>
       </div>
       <span class="Validform_checktip">*无小数点为整型，否则浮点数</span>
     </dd>
   </dl>
  <dl id="dlItemOptionDataSource" runat="server">
    <dt>选项列表数据源</dt>
    <dd>
      <div class="rule-single-select">
        <asp:DropDownList ID="ddlItemOptionDataSource" runat="server" CssClass="uk-select" AutoPostBack="True" OnSelectedIndexChanged="ddlItemOptionDataSource_SelectedIndexChanged">
          </asp:DropDownList>
       </div>
     </dd>
  </dl>
   <dl id="dlItemOption" runat="server" class="multi-radio-tr multi-checkbox-tr">
    <dt>选项列表</dt>
    <dd>
      <asp:TextBox ID="txtItemOption" runat="server" CssClass="uk-textarea" Rows="5"  TextMode="MultiLine"></asp:TextBox>
      <div>*填写说明：选项名称|值，以回车换行为一行。</div>
    </dd>
  </dl>

   <dl>
    <dt>默认值</dt>
    <dd><asp:TextBox ID="txtDefaultValue" runat="server" CssClass="uk-input"></asp:TextBox> <span class="Validform_checktip">*控件的默认字符，可为空。当前用户{userinfo.id}当前角色{userinfo.role_id}</span></dd>
  </dl>

  <dl id="dlValidPattern" runat="server">
    <dt>验证正则表达式</dt>
    <dd><asp:TextBox ID="txtValidPattern" runat="server" CssClass="uk-textarea" TextMode="MultiLine"></asp:TextBox> <span class="Validform_checktip">*不填写则不验证</span></dd>
  </dl>
  <dl id="dlValidPatternHelper" runat="server">
    <dt>正则帮助</dt>
    <dd>
        <select id="ddlRegularExpression" class="uk-select">
            <option value="">无</option>
            <option value="/^.{1,}$/">不为空</option>
            <option value="/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/">完整时间yyyy-MM-dd HH:mm:ss</option>
            <option value="/^(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/">时间HH:mm:ss</option>
            <option value="/^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/">日期yyyy-MM-dd</option>
            <option value="/^[0-9]*$/">数字</option>
            <option value="/^.{3,20}$/">验证3-20个字符</option>
            <option value="/^\d{n}$/">n位的数字</option>
            <option value="/^\d{n,}$/">至少n位数字</option>
            <option value="/^\d{m,n}$/">m-n位的数字</option>
            <option value="/^(0|[1-9][0-9]*)$/">零和非零开头的数字</option>
            <option value="/^[0-9]+(.[0-9]{2})?$/">有两位小数的正实数</option>
            <option value="/^\+?[1-9][0-9]*$/">非零的正整数</option>
            <option value="/^\-[1-9][0-9]*$/">非零的负整数</option>
            <option value="/^((-\d+)|(0+))$/">非负整数</option>
            <option value="/^.{3}$/">长度为3的字符</option>
            <option value="/^[A-Za-z]+$/">由26个英文字母组成的字符串</option>
            <option value="/^[A-Z]+$/">由26个大写英文字母组成的字符串</option>
            <option value="/^[a-z]+$/">由26个小写英文字母组成的字符串</option>
            <option value="/^[A-Za-z0-9]+$/">由数字和26个英文字母组成的字符串</option>
            <option value="/^\w+$/">由数字、26个英文字母或者下划线组成的字符串</option>
            <option value="/^[\u4e00-\u9fa5],{0,}$/">验证汉字</option>
            <option value="/^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}([0-9]|x|X)$/">身份证号</option>
            <option value="/^-?\d+$/">整数</option>
            <option value="/^\d+(\.\d+)?$/">非负小数</option>
            <option value="/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/">正小数</option>
            <option value="/^((-\d+(\.\d+)?)|(0+(\.0+)?))$/">非正小数</option>
            <option value="/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/">负小数</option>
            <option value="/^(-?\d+)(\.\d+)?$/">小数</option>
            <option value="/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/">IPv4</option>
            <option value="/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/">域名</option>
            <option value="/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/">Email</option>
            <option value="/^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$ ；^[a-zA-z]+://(w+(-w+)*)(.(w+(-w+)*))*(?S*)?$/">URL</option>
            <option value="/^(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}$/">电话号码</option>
        </select>

    </dd>
  </dl>
  <dl>
    <dt>验证提示信息</dt>
    <dd><asp:TextBox ID="txtValidTipMsg" runat="server" CssClass="uk-textarea" TextMode="MultiLine"></asp:TextBox></dd>
  </dl>

  <dl id="dlValidErrorMsg" runat="server">
    <dt>验证失败信息</dt>
    <dd><asp:TextBox ID="txtValidErrorMsg" runat="server" CssClass="uk-textarea" TextMode="MultiLine"></asp:TextBox></dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="uk-button uk-button-primary " onclick="btnSubmit_Click" />
    <input name="btnReturn" type="button" value="取消返回" class="uk-button uk-button-default " onclick="javascript:history.back(-1);" />
  </div>
</div>
<!--/工具栏-->

</form>
</body>
</html>
